package cn.acmenms.po.enums;

/**
 * @ClassName: SourceForm
 * @Description: 客户端来源枚举
 * @author: 神奇的鸭鸭
 * @Date: 2018/2/10 11:30
 */
public enum SourceFrom {

    PC("P", "windows"),
    A("A", "android"),
    I("I", "mac os");

    private String type;
    private String desc;

    SourceFrom(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static SourceFrom getSourceFormByValue(String type) {
        if(null == type) {
            return null;
        }
        for (SourceFrom s : SourceFrom.values()) {
            if(s.getType().equals(type)) {
                return s;
            }
        }
        return null;
    }
}